package com.heima.controller;

import com.heima.model.dtos.LoginAuthDto;
import com.heima.model.vos.Result;
import com.heima.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author itheima
 * @since 2022-12-28
 */
@RestController
@RequestMapping("/api/v1/login")
public class LoginController {

    @Autowired
    private UserService userService;

    @PostMapping("/login_auth")
    public Result loginAuth(@RequestBody LoginAuthDto dto) {
        return Result.success(userService.login(dto));
    }

}
